package com.ruoyi.framework.config;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.ruoyi.framework.method.MysqlInsertAllBatch;
import com.ruoyi.framework.method.UpdateBatchMethod;
import org.springframework.stereotype.Component;


import java.util.List;

/**
 * @ClassName MyLogicSqlInjector
 * @Author CBL
 * @Date 2022/6/23 13:51
 **/
// @Component
public class MyLogicSqlInjector extends DefaultSqlInjector {
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new MysqlInsertAllBatch(tableInfo.getTableName()+ "_InsertAllBatch"));
        methodList.add(new UpdateBatchMethod(tableInfo.getTableName()+ "_UpdateAllBatch"));
        return methodList;
    }
}
